import {numberFormat} from '@/util/util'

export const defaultOption = {
  border: true,
  index: true,
  indexLabel: "序号",
  stripe: true,
  menuAlign: "center",
  align: "center",
  columnBtn: false,
  dialogClickModal: false
}

export function columnDefaultOption(columns){
  for(let column of columns){
    if(column.type == 'number' && column.precision){
      column.formatter = function(row,value,label,column)	{
        return numberFormat(value, column.precision)
      }
    }
  }
  return columns
}
